package core;

import config.LineDefaultEnvironment;
import config.LineEnvironment;
import jdk.nashorn.internal.objects.annotations.Property;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * Create Time: 2018年01月25日 20:32
 *
 * @author fin
 */
@Component
public class LineLoader {

    private LineDefaultEnvironment env;

    public void run() throws Exception {
        Logger logger = LogManager.getLogger(LineLoader.class);
        logger.debug("{} has run in {} port", env.getMode(), env.getPort());
        new LineServer(env.getPort()).run();
    }

    public void setEnv(LineDefaultEnvironment env) {
        this.env = env;
    }
}
